<template>
  <div class="file-list">
    <file-item
      v-for="(file, index) in fileList"
      :key="index"
      :fileInfo="file"
      class="file"
      @click="clickFile"
    />
  </div>
</template>

<script>
import FileItem from '@/components/FileItem'
export default {
  components: {
    FileItem,
  },
  props: {
    fileList: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    clickFile(fileInfo) {
      this.$emit('click', fileInfo)
    },
  },
}
</script>

<style lang="less" scoped>
.file-list {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
}
</style>
